Skip to content

Conversation

@franzpoeschel
Copy link
Contributor

  1. Compile warnings in Attribute.hpp:
    g++ 11 does not understand that these variables are not primitive types
    and complains about possibly uninitialized values. Use the {}
    constructor to fix this.
  2. We still had two instances of AccessType in the tests, replace this with Access

std::unique_ptr<openPMD::Series> series_ptr;
{
openPMD::Series series(
"sample%T.json", openPMD::AccessType::CREATE);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We left those intentionally to test that the old type still works.

We could silence this at one last location with a local suppressor?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was under the impression that they sneaked in because this test comes from a long-standing pull request (the bug tested by this took a long time to fix).
But we can definitely use the chance to test for existence of AccessType with this

@ax3l ax3l self-assigned this Mar 7, 2022
@ax3l ax3l changed the title Fix some compile warnings Fix GCC 11 Compiler Warnings Mar 7, 2022
@ax3l ax3l force-pushed the fix-compile-warnings branch from bae466f to 2d68c79 Compare March 7, 2022 18:32
@ax3l
Copy link
Member

ax3l commented Mar 7, 2022

PR rebased.

@franzpoeschel franzpoeschel force-pushed the fix-compile-warnings branch from 2d68c79 to 62a4c4c Compare March 8, 2022 12:05
G++ 11 does not understand that these variables are not primitive types
and complains about possibly uninitialized values. Use the {}
constructor to fix this.
@franzpoeschel franzpoeschel force-pushed the fix-compile-warnings branch from 62a4c4c to 8d736b4 Compare March 8, 2022 12:18
}

(void)pv;
throw std::runtime_error("getCast: no cast possible.");
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to put these into an else branch, ICC seems to determine unreachable statements after resolving if constexpr

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah classic. a range of NVCC 11 minor releases does that as well

ICC seems to resolve reachability of statements after resolving
constexpr if
1. Reset to default warning behavior after disabling
2. Use __GNUC_MINOR__ instead of __GNUC__
@franzpoeschel franzpoeschel requested a review from ax3l March 24, 2022 08:48
*/
#if defined(__GNUC__MINOR__) || defined(__clang__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
Copy link
Member

@ax3l ax3l Mar 29, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With this one set, you can remove -Wno-deprecated-declarations from quite a few CI scripts in .github/workflows/

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-> #1246

@ax3l ax3l merged commit 88c3ad1 into openPMD:dev Apr 15, 2022
/*
* clang also understands these pragmas.
*/
#if defined(__GNUC__MINOR__) || defined(__clang__)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo fixed in #1255: __GNUC_MINOR__

#if defined(__INTEL_COMPILER)
#pragma warning(disable : 2282)
#endif
#if defined(__GNUC__MINOR__) || defined(__clang__)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

ax3l added a commit to ax3l/openPMD-api that referenced this pull request Apr 29, 2022
There was a typo in `__GNUC_MINOR__`, causing the test not to work on all GCC versions.

Follow-up to openPMD#1213
ax3l added a commit to ax3l/openPMD-api that referenced this pull request Apr 29, 2022
There was a typo in `__GNUC_MINOR__`, causing the test not to work on all GCC versions.

Follow-up to openPMD#1213
ax3l added a commit that referenced this pull request Apr 29, 2022
There was a typo in `__GNUC_MINOR__`, causing the test not to work on all GCC versions.

Follow-up to #1213
@ax3l ax3l modified the milestones: 0.14.5, 0.14.6 May 25, 2022
@ax3l
Copy link
Member

ax3l commented May 25, 2022

I have problems applying this and the following PRs to the release-0.14.5 branch

franzpoeschel pushed a commit to franzpoeschel/openPMD-api that referenced this pull request May 30, 2022
There was a typo in `__GNUC_MINOR__`, causing the test not to work on all GCC versions.

Follow-up to openPMD#1213
franzpoeschel pushed a commit to franzpoeschel/openPMD-api that referenced this pull request May 31, 2022
There was a typo in `__GNUC_MINOR__`, causing the test not to work on all GCC versions.

Follow-up to openPMD#1213
ax3l added a commit to ax3l/openPMD-api that referenced this pull request Jun 6, 2022
* Don't safeguard empty strings while reading

* Update TODO Comment

* Add missing update for VEC_CLONG_DOUBLE

* Ignore deprecated AccessType in SerialIOTest

* SerialIOTest: Fix GCC Pragma Check (openPMD#1260)

There was a typo in `__GNUC_MINOR__`, causing the test not to work on all GCC versions.

Follow-up to openPMD#1213

* Clearly fail when users select a wrong backend

* ICC: Unreachable end of function

* Fix use after free in ADIOS1IOHandler

* Remove unavailable_backend_test

Hard to trigger without explicit backend selection, and test coverage is
present on dev anyway

Co-authored-by: Axel Huebl <[email protected]>
@ax3l ax3l modified the milestones: 0.14.6, 0.14.5 Jun 6, 2022
@ax3l
Copy link
Member

ax3l commented Jun 6, 2022

Applied to 0.14.5 via ax3l#6 🎉

ax3l added a commit that referenced this pull request Jun 7, 2022
* Improve write time

* Print warning if mpi4py is not found in openpmd-pipe

* ADIOS1: Remove task from IO queue if it fails with exception

* `setup.py`: Extra CMake Arg Control

* EMSCRIPTEN: Skip Py Extension

* g++/clang++: Add `-Wsign-compare`

* python/RecordComponent: fix `-Wsign-compare`

* Patch MSVC pybind11 bug

Improve patch comment

* Python: Do Not Strip Symbols In Debug

Avoid stripping symbols for Python debug builds, so we can see lines
in coredumps and debugger runs.

* CI: NVHPC New Apt Repo

Update the NVHPC install instructions to the latest and greatest.
Fix failing CI (dependency install).

Also upgrade to 21.11 as on Perlmutter.

* clang-format & pre-commit & python include

* run pre-commit

* ps_make_timer_name_: add memory leak suppression

* Fix: Missing HDF5 Include

This tries to fix a compile error on Maxwell (DESY).
```
/home/diederse/software/hipace_4GPU/hipace/build/_deps/fetchedopenpmd-src/src/IO/HDF5/HDF5IOHandler.cpp: In member function 'virtual void openPMD::HDF5IOHandlerImpl::readAttribute(openPMD::Writable*, openPMD::Parameter<openPMD::Operation::READ_ATT>&)':
/home/diederse/software/hipace_4GPU/hipace/build/_deps/fetchedopenpmd-src/src/IO/HDF5/HDF5IOHandler.cpp:1586:17: error: 'H5free_memory' was not declared in this scope
 1586 |                 H5free_memory(m1);
      |                 ^~~~~~~~~~~~~
/home/diederse/software/hipace_4GPU/hipace/build/_deps/fetchedopenpmd-src/src/IO/HDF5/HDF5IOHandler.cpp:1609:17: error: 'H5free_memory' was not declared in this scope
 1609 |                 H5free_memory(m1);
      |                 ^~~~~~~~~~~~~
/home/diederse/software/hipace_4GPU/hipace/build/_deps/fetchedopenpmd-src/src/IO/HDF5/HDF5IOHandler.cpp:1628:17: error: 'H5free_memory' was not declared in this scope
 1628 |                 H5free_memory(m2);
      |                 ^~~~~~~~~~~~~
```

* Increase reference count also in other load_chunk overload

Don't know if it is necessary, but looks like we forgot it earlier

Add comment

* Spack: Remove Old Files

* Spack: v0.17.1

* Update Env Files

* Python Iteration: Fix __repr__ (time)

Small numbers, as common for iterations, were flushed to zero
in `std::to_string(double)` of the representation of `Iteration`
variables:
```
step    __repr__
100     <openPMD.Iteration at t = '0.000000 s'>
was:    8.687655225973454e-14 * 1.0
```

* CI: Update CUDA repo key

Nvidia has made changes in the signing keys.

https://forums.developer.nvidia.com/t/notice-cuda-linux-repository-key-rotation/212771

* CI: Switch to Mamba

* Doc: Update HDF5 Coll. Metadata Versions

Update the documentation about HDFFV-11260 and the newly released
fixes in release lines.

* HDF5 Coll. MD Reads: Simplify Wording

* Tiny wording improvement and a +

* Remove deprecated debug parameter in ADIOS2

* HDF5IOHandler: Clang-Format/Clang-Tidy

```
/home/runner/work/openPMD-api/openPMD-api/src/IO/HDF5/HDF5IOHandler.cpp:1835:21:
  warning: repeated branch in conditional chain [bugprone-branch-clone]
                    isLegacyLibSplashAttr =
                    ^
```

* `conda.yaml`: add `pre-commit`

* Fix: Python Variant Issue on Conda

* Test: Demonstrate Pattern Issue

As in #1173

* JSON: Improve File Open Error Message

Include path to file

* Upon parsing, store each iteration's filename

If the padding is inconsistent, a later Iteration::open() needs the
original filename. Trying to compute the filename from the expansion
pattern will lead to wrong filenames.

* Backport: fix-open-iteration (#5)

* Pass-through flushing parameters

* CI fixes

* Test

* Don't flush when opening an iteration

* CI fixes

* FlushLevel: Use default base class in NVC++

* clang-tidy: Define member defaults of Writable in-class

* Update include/openPMD/IO/AbstractIOHandler.hpp

Co-authored-by: Axel Huebl <[email protected]>

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Release 0.14.5 conflicting backports (#6)

* Don't safeguard empty strings while reading

* Update TODO Comment

* Add missing update for VEC_CLONG_DOUBLE

* Ignore deprecated AccessType in SerialIOTest

* SerialIOTest: Fix GCC Pragma Check (#1260)

There was a typo in `__GNUC_MINOR__`, causing the test not to work on all GCC versions.

Follow-up to #1213

* Clearly fail when users select a wrong backend

* ICC: Unreachable end of function

* Fix use after free in ADIOS1IOHandler

* Remove unavailable_backend_test

Hard to trigger without explicit backend selection, and test coverage is
present on dev anyway

Co-authored-by: Axel Huebl <[email protected]>

* Version: 0.14.5

including Changelog

Co-authored-by: Jean Luca Bez <[email protected]>
Co-authored-by: Franz Pöschel <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants